{extend name="Public:base" /}
       {block name="seo"}
        <title>登录页|{$Think.CONFIG.WEB_SITE_TITLE} - Powered by EasySNS!</title>
  
  
  <meta name="keywords" content="{$Think.CONFIG.WEB_SITE_KEYWORD}">
  <meta name="description" content="{$Think.CONFIG.WEB_SITE_DESCRIPTION}">
      {/block}
            {block name="css"}
     <link rel="stylesheet" type="text/css" href="__CSS__/user.css" />
     <style>
     .other-account li a {
    display: inline-block;
    width: 240px;
    height: 36px;
    line-height: 36px;
    font-size: 16px;
    text-align: center;
    color: #007DDB;
    background: none repeat scroll 0 0 #EEEEEE;
}
     </style>
      {/block}
{block name="body"}
<div class="login">
	
		<div class="main  container">
			<div class="mainLeft">
				<h3 class="hidden-xs"><span class="active">账号登录</span><span><a href="{:es_url('user/register')}">立即注册</a></span></h3>
				<form class="form-horizontal es-margin-t-20" id="loginform">
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">用户名</label>
    <div class="col-sm-6">
      <input type="text" class="form-control" id="username" name="username" placeholder="用户名">
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
    <div class="col-sm-6">
      <input type="password" class="form-control" id="password" name="password" placeholder="密码">
    </div>
  </div>
    {if condition="$yzm eq 1"}


    <div class="form-group clearfix">
   
   <label for="inputPassword3" class="col-sm-2 control-label">验证码</label>
    <div class="col-sm-7">
      <input type="text" style="float:left;width:100px;" class="form-control" id="verify" name="verify" placeholder="4位验证码">
   <img id="captcha" src="{:es_url('user/getcode')}" onclick="this.src='{:es_url('user/getcode')}?'+Math.random();" class="es-margin-l-10 pull-left" style="height:40px;" />
    </div>
  </div>
{/if}
  <div class="form-group "> 
  
  
    <div class="col-sm-offset-2 col-sm-6">
    
      <div class="checkbox">

    <div class="pull-right"><a href="{:url('User/forget')}">忘记密码</a></div>
  </div>
    
     
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-6">
      <a id="submit" href="javascript:;" class="btn btn-success  btn-block">登 录</a>
    </div>
  </div>
</form>
			</div>
			<div class="mainRight hidden-xs">
				
				<div class="hd">
                <strong>使用其他帐号直接登录</strong>
            </div>
            <div class="bd">
                <ul class="other-account">
                    <li><a class="qq" href="{:es_url('Ologin/login',array('name'=>'qq'))}">腾讯QQ登录</a></li>
                
               </ul>
            </div>
				
			</div>
		</div>
	</div>
{/block}
{block name="script"}
<script>
$(function(){
	
	  $('#submit').click(function(){
		 
		   loading = layer.load(2, {
			      shade: [0.2,'#000']
			    });
		    $.post('{:es_url("user/loginHandle")}',$('form#loginform').serialize(),function(data){
		    	
		      if(data.code == 1){
		        layer.close(loading);
		        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
		          location.href = '{:es_url("index/index")}';
		        });
		      }else{
		        layer.close(loading);
		        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
		        
		        $('#captcha').attr('src',"{:es_url('user/getcode')}?"+Math.random());
		        
		      }
		    });
		    return false;
		  });
	
})
</script>

{/block}